package com.study.liuxy.springboot3.bean.base;

import com.study.liuxy.springboot3.constants.retcode.RetCodeEnum;
import lombok.Data;

@Data
public class BaseRes<T> {

    private String retCode;

    private String retMsg;

    private T data;

    public static <T> BaseRes<T> success(T data) {
        BaseRes<T> baseRes = new BaseRes<>();
        baseRes.setRetCode(RetCodeEnum.SUCCESS.getRetCode());
        baseRes.setRetMsg(RetCodeEnum.SUCCESS.getRetMsg());
        baseRes.setData(data);
        return baseRes;
    }
}
